package com.atguigu.gmall.feign.cart;

import com.atguigu.gmall.common.result.Result;
import com.atguigu.gmall.model.cart.entity.CartInfo;
import com.atguigu.gmall.model.cart.vo.AddSuccessVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * @Author:lyd
 **/
@FeignClient("service-cart")
@RequestMapping("/api/inner/cart")
public interface CartFeignClient {

    @GetMapping("/add/{skuId}")
    Result<AddSuccessVo> addCart(@PathVariable("skuId") Long skuId,
                   @RequestParam("skuNum") Long skuNum);

    @GetMapping("/deleteChecked")
    Result deleteChecked();

    /**
     * 获取购物车中选中的商品列表
     */
    @GetMapping("checked/list")
    Result<List<CartInfo>> checkedList();
}
